#diadyn-chat-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #7B5EA7;
    border: none;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 4px 24px rgba(91, 63, 138, 0.45);
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-transition: transform 0.2s ease, box-shadow 0.2s ease;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#diadyn-chat-btn:hover {
    -webkit-transform: scale(1.08);
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(91, 63, 138, 0.6);
}
#diadyn-chat-btn svg { width: 28px; height: 28px; fill: #ffffff; }
#diadyn-chat-pulse {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(91, 63, 138, 0.25);
    z-index: 99998;
    -webkit-animation: dPulse 2s infinite;
    animation: dPulse 2s infinite;
}
@-webkit-keyframes dPulse {
    0% { -webkit-transform: scale(1); transform: scale(1); opacity: 0.8; }
    100% { -webkit-transform: scale(1.7); transform: scale(1.7); opacity: 0; }
}
@keyframes dPulse {
    0% { -webkit-transform: scale(1); transform: scale(1); opacity: 0.8; }
    100% { -webkit-transform: scale(1.7); transform: scale(1.7); opacity: 0; }
}
#diadyn-chat-window {
    position: fixed;
    bottom: 106px;
    right: 28px;
    width: 380px;
    max-height: 580px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e8e4f0;
    box-shadow: 0 24px 70px rgba(91, 63, 138, 0.15);
    z-index: 99997;
    display: none;
    -webkit-flex-direction: column;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
}
#diadyn-chat-window.open { display: -webkit-flex; display: flex; }
#diadyn-chat-header {
    background: #7B5EA7;
    padding: 14px 18px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}
#diadyn-chat-header .d-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: -webkit-flex; display: flex;
    -webkit-align-items: center; align-items: center;
    -webkit-justify-content: center; justify-content: center;
    font-weight: 700; font-size: 15px; color: #ffffff;
    -webkit-flex-shrink: 0; flex-shrink: 0;
    margin-right: 10px;
}
#diadyn-chat-header .d-info { -webkit-flex: 1; flex: 1; min-width: 0; }
#diadyn-chat-header .d-name { font-size: 14px; font-weight: 600; color: #ffffff; }
#diadyn-chat-header .d-status {
    font-size: 11px; color: rgba(255, 255, 255, 0.85);
    display: -webkit-flex; display: flex;
    -webkit-align-items: center; align-items: center;
    margin-top: 2px;
}
#diadyn-chat-header .d-status::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: #a8edcc; display: inline-block;
    -webkit-flex-shrink: 0; flex-shrink: 0; margin-right: 5px;
}
#diadyn-close-btn {
    background: none; border: none; cursor: pointer;
    color: rgba(255, 255, 255, 0.85); font-size: 22px;
    padding: 0; line-height: 1;
    -webkit-flex-shrink: 0; flex-shrink: 0; margin-left: 8px;
}
#diadyn-page-ctx {
    background: #f8f5ff; border-bottom: 1px solid #e8e4f0;
    padding: 6px 16px; font-size: 11px; color: #7B5EA7;
    font-weight: 600; -webkit-flex-shrink: 0; flex-shrink: 0;
}
#diadyn-messages {
    -webkit-flex: 1; flex: 1; overflow-y: auto;
    padding: 14px 14px 8px;
    display: -webkit-flex; display: flex;
    -webkit-flex-direction: column; flex-direction: column;
    background: #ffffff;
}
#diadyn-messages .d-msg { margin-bottom: 10px; }
.d-msg {
    max-width: 88%; padding: 10px 14px; border-radius: 16px;
    font-size: 13px; line-height: 1.55; word-break: break-word;
}
.d-msg.bot {
    background: #f8f5ff; color: #2d2040;
    border-bottom-left-radius: 4px;
    -webkit-align-self: flex-start; align-self: flex-start;
    border: 1px solid #e8e4f0;
}
.d-msg.user {
    background: #7B5EA7; color: #ffffff;
    border-bottom-right-radius: 4px;
    -webkit-align-self: flex-end; align-self: flex-end;
}
.d-typing { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; padding: 12px 14px; }
.d-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: #7B5EA7;
    -webkit-animation: dBounce 1.2s infinite; animation: dBounce 1.2s infinite;
    margin-right: 5px;
}
.d-typing span:nth-child(2) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s; }
.d-typing span:nth-child(3) { -webkit-animation-delay: 0.4s; animation-delay: 0.4s; }
@-webkit-keyframes dBounce {
    0%, 60%, 100% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 0.35; }
    30% { -webkit-transform: translateY(-7px); transform: translateY(-7px); opacity: 1; }
}
@keyframes dBounce {
    0%, 60%, 100% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 0.35; }
    30% { -webkit-transform: translateY(-7px); transform: translateY(-7px); opacity: 1; }
}
#diadyn-choices {
    padding: 8px 14px 4px;
    display: -webkit-flex; display: flex;
    -webkit-flex-wrap: wrap; flex-wrap: wrap;
    -webkit-flex-shrink: 0; flex-shrink: 0;
    background: #ffffff;
}
#diadyn-choices .d-choice { margin: 0 6px 6px 0; }
.d-choice {
    background: #ffffff; border: 1px solid #7B5EA7; color: #7B5EA7;
    border-radius: 22px; padding: 6px 14px; font-size: 12px;
    cursor: pointer; font-family: inherit; font-weight: 500;
    -webkit-transition: all 0.15s; transition: all 0.15s; white-space: nowrap;
}
.d-choice:hover { background: #7B5EA7; color: #ffffff; }
#diadyn-input-row {
    padding: 10px 12px; border-top: 1px solid #e8e4f0;
    display: -webkit-flex; display: flex;
    -webkit-align-items: flex-end; align-items: flex-end;
    background: #ffffff; -webkit-flex-shrink: 0; flex-shrink: 0;
}
#diadyn-input {
    -webkit-flex: 1; flex: 1; background: #f8f5ff;
    border: 1px solid #e8e4f0; border-radius: 14px;
    padding: 9px 14px; color: #2d2040; font-size: 13px;
    font-family: inherit; resize: none; outline: none;
    max-height: 90px; line-height: 1.5;
    -webkit-transition: border-color 0.2s; transition: border-color 0.2s;
    margin-right: 8px;
}
#diadyn-input:focus { border-color: #7B5EA7; }
#diadyn-send-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: #7B5EA7; border: none; cursor: pointer;
    display: -webkit-flex; display: flex;
    -webkit-align-items: center; align-items: center;
    -webkit-justify-content: center; justify-content: center;
    -webkit-flex-shrink: 0; flex-shrink: 0;
    -webkit-transition: transform 0.15s, opacity 0.15s;
    transition: transform 0.15s, opacity 0.15s;
}
#diadyn-send-btn:hover { -webkit-transform: scale(1.08); transform: scale(1.08); }
#diadyn-send-btn:disabled { opacity: 0.35; cursor: not-allowed; -webkit-transform: none; transform: none; }
#diadyn-send-btn svg { width: 16px; height: 16px; fill: #ffffff; }
.d-footer-note {
    text-align: center; font-size: 11px; color: #b0a8c0;
    padding: 6px 0 10px; -webkit-flex-shrink: 0; flex-shrink: 0;
    background: #ffffff;
}
.d-footer-note a { color: #7B5EA7; text-decoration: none; }
@media (max-width: 430px) {
    #diadyn-chat-window { width: calc(100vw - 20px); right: 10px; bottom: 100px; }
    #diadyn-chat-btn { right: 10px; }
    #diadyn-chat-pulse { right: 10px; }
}
#diadyn-lang-select {
    width: 100%;
    background-color: #ffffff;
    border: none;
    border-radius: 0;
    padding: 6px 14px;
    font-size: 13px;
    color: #2d2040;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%237B5EA7' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;

    padding-right: 34px;
}

#diadyn-lang-bar {
    background: #f8f5ff;
    border-bottom: none;
    padding: 8px 0;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}
